#ifndef __SERVER_H__
#define __SERVER_H__

#include "../../test_type.h"
#include "../../../src/socket/TcpIoServer.h"
#include "../../../src/socket/TcpIoSocket.h"
#include "../../../src/stream/SocketIoBuffer.h"
#include <iostream>
#include <memory>

namespace echo_service
{
	using namespace std;
	using namespace LibTools;

	class Session;

	class Service
	{
	public:
		Service();
		~Service();

		void Start(const char* addr = "127.0.0.1", DWORD port = 10003);

		static void StartAccept(CTcpIoServer* s, CTcpIoSocket& svrSock);

		static DWORD HandleAccept(CSockError ec, void* invoker);

	public:
		shared_ptr<CTcpIoServer> _tcp;
		CTcpIoSocket _svrSock;
	};
}

#endif